package org.hefan.hrm.client;

import org.hefan.hrm.domain.LoginUser;
import org.hefan.hrm.util.AjaxResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * LoginUser服务的客户端
 * 提供一个客户端在这里,谁用谁注入,即可调用方法
 */
@FeignClient(value = "HRM-AUTH", fallbackFactory = LoginUserClientFallBackFactory.class)
// 这里loginUserClient的RequestMapping和loginUserController的RequestMapping一致
// 调用者才能通过客户端去调用被调用者的controller
@RequestMapping("/loginUser")
public interface LoginUserClient {

    @PutMapping
    AjaxResult addOrUpdate(@RequestBody LoginUser loginUser);
}
